<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Bootstrap core CSS -->
    <link th:href="@{../asserts/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link th:href="@{../asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }

        .hidden {
            display: none !important;
        }
    </style>
</head>

<body>
<nav class="navbar sticky-top flex-md-nowrap p-0" th:fragment="topbar"
     style="height:60px;box-shadow:0 0.5rem 1rem rgba(0,0,0,.05), inset 0 -1px 0 rgba(0,0,0,.1);">
    <h2 class="navbar-white bg-white col-sm-3 col-md-1 mr-0">Супермаркет</h2>
    <div class="btn-group px-3">
        <button type="button" class="btn dropdown-toggle btn-outline-primary" data-toggle="dropdown"
                data-display="static" aria-haspopup="true" aria-expanded="false"
                th:text="${#session.getAttribute('VIP').username}">
        </button>
        <div class="dropdown-menu dropdown-menu-right">
            <div role="separator" class="dropdown-divider"></div>
            <a class="dropdown-item" th:href="@{/logout}">Выйти</a>
        </div>
    </div>
</nav>
<div class="container-fluid">
    <div class="row">
        <!--引入侧边栏-->
        <nav class="col-md-2 d-none d-md-block bg-white sidebar">
            <div class="sidebar-sticky">
                <ul class="nav flex-column">
                    <li class="nav-item">
                        <a class="nav-link" th:href="@{/vipMain.html}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                 fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                 stroke-linejoin="round" class="feather feather-home">
                                <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                                <polyline points="9 22 9 12 15 12 15 22"></polyline>
                            </svg>
                            Добро пожаловать <span class="sr-only">(current)</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" th:href="@{/toChangeVipInfo}">
                            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                                 fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                                 stroke-linejoin="round" class="feather feather-file">
                                <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path>
                                <polyline points="13 2 13 9 20 9"></polyline>
                            </svg>
                            Персональные данные
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>Персональные данные</h2>
            <form th:action="@{/changeVipInfo}" method="post">
                <input type="hidden" name="_method" value="put" th:if="${#session.getAttribute('VIP') ne null}">
                <div class="form-group hidden">
                    <th:block th:if="${#session.getAttribute('VIP') ne null}">
                        <label for="id"></label>
                        <input type="text" class="form-control" id="id" name="id"
                               th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').id}">
                    </th:block>
                </div>
                <div class="form-group">
                    <label for="username">Имя пользователя</label>
                    <input type="text" class="form-control" id="username" name="username"
                           th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').username}"
                           required>
                </div>
                <div class="form-group">
                    <label for="password">Пароль</label>
                    <input type="password" class="form-control" id="password" name="password"
                           th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').password}"
                           required>
                </div>
                <fieldset class="form-group">
                    <legend class="col-form-label pt-0">Пол</legend>
                    <div class="custom-control custom-radio custom-control-inline">
                        <input type="radio" id="vipGender1" name="vipGender"
                               class="custom-control-input" value="01"
                               th:checked="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').vipGender} eq '01'">
                        <label class="custom-control-label" for="vipGender1">Мужчина</label>
                    </div>
                    <div class="custom-control custom-radio custom-control-inline">
                        <input type="radio" id="vipGender2" name="vipGender"
                               class="custom-control-input" value="02"
                               th:checked="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').vipGender} eq '02'">
                        <label class="custom-control-label" for="vipGender2">Женский пол</label>
                    </div>
                </fieldset>
                <div class="form-group">
                    <label for="vipNumber">Номер VIP</label>
                    <input type="text" class="form-control" id="vipNumber" name="vipNumber"
                           th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').vipNumber}"
                           required>
                </div>
                <div class="form-group">
                    <label for="datetimepicker">VIP День Рождения</label>
                    <div class="input-append date" id="datetimepicker" data-date="" data-date-format="dd/mm/yyyy"
                         disabled>
                        <input id="vipBirthday" class="form-control" type="text"
                               th:value="${#session.getAttribute('VIP') ne null}?${#dates.format(#session.getAttribute('VIP').vipBirthday,'dd/MM/yyyy')}"
                               name="vipBirthday" required>
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputFourthLevel">Расположение магазина</label>
                    <select id="inputFourthLevel" class="form-control" name="vipPlace">
                        <option th:selected="${null}">Выбирать...</option>
                        <option th:each="fourth : ${fourthLevel}" th:text="${fourth.fourthLevelName}"
                                th:value="${fourth.fourthLevelName}"
                                th:selected="${#session.getAttribute('VIP') ne null}?${fourth.fourthLevelName} eq ${#session.getAttribute('VIP').vipPlace}"></option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="vipShopId">VIP магазин</label>
                    <select id="vipShopId" class="form-control" name="vipShopId">
                        <option th:selected="${null}">Выбирать...</option>
                        <option th:each="shopInfo : ${shopInfos}" th:text="${shopInfo.shopId}"
                                th:value="${shopInfo.shopId}"
                                th:selected="${#session.getAttribute('VIP') ne null}?${shopInfo.shopId} eq ${#session.getAttribute('VIP').vipShopId}"></option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="vipCardCode">Код VIP карты</label>
                    <div class="input-group">
                        <input type="text" class="form-control" id="vipCardCode" name="vipCardCode"
                               th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').vipCardCode}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="vipIntegration">Интеграция VIP</label>
                    <div class="input-group">
                        <input type="text" class="form-control" id="vipIntegration" name="vipIntegration"
                               th:value="${#session.getAttribute('VIP') ne null}?${#session.getAttribute('VIP').vipIntegration}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="datetimepicker2">Дата регистрации</label>
                    <div class="input-append date" id="datetimepicker2" data-date="" data-date-format="dd/mm/yyyy"
                         disabled>
                        <input id="vipRegisterDate" class="form-control" type="text"
                               th:value="${#session.getAttribute('VIP') ne null}?${#dates.format(#session.getAttribute('VIP').vipRegisterDate,'dd/MM/yyyy')}"
                               name="vipRegisterDate" required>
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>
                </div>
                <div class="form-group">
                    <input type="submit" class="btn btn-primary" value="Представить">
                </div>
            </form>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="../../asserts/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="../asserts/js/popper.min.js"></script>
<script type="text/javascript" src="../asserts/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../asserts/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="../asserts/js/locales/bootstrap-datetimepicker.ru.js"></script>

<!-- Icons -->
<script type="text/javascript" src="../asserts/js/feather.min.js"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script type="text/javascript" src="../asserts/js/Chart.min.js"></script>

<script>
    $('#datetimepicker').datetimepicker({
        language: 'ru',
        minView: 'month',
        autoclose: true,
        setStartDate: new Date(),
        todayBtn: true,
        todayHighlight: true,
        keyboardNavigation: true
    }).on('changeDate', function (ev) {
        $(this).datetimepicker('hide');
    });

</script>

</body>
</html>